package com.zjgsu.nftplatform.mapper;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @author ahy231
 * @date 2021/7/23 14:15
 * @description
 */
@Mapper
public interface CommonMapper {

    @Select("SELECT r.`name` FROM `user` u LEFT JOIN user_role ur ON u.id = ur.user_id LEFT JOIN role r ON ur.role_id = r.id WHERE u.id = #{userId}")
    List<String> getRolesByUserId(long userId);
}
